package cn.txun.springboot61.mapper;

import cn.txun.springboot61.entity.Weibo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface WeiboMapper {

    int insert(Weibo weibo);

    List<Weibo> select();

    int delete(int id);
    @Select("select id,content,created from weibo " +
            "where user_id=#{id} order by created desc")
    List<Weibo> selectByUserId(Integer id);
    @Select("select * from weibo where id=#{id}")
    Weibo selectById(int id);
}
